package com.demo.wrapper.interfaces;

import com.demo.wrapper.enums.AggEnum;
import com.demo.wrapper.pojo.Agg;

/**
 * 自定义聚合条件
 *
 * @param <Wrapper>    条件拼接类，需继承Limit接口
 * @param <AggWrapper> 聚合拼接类，需继承Agg接口
 * @param <Arg>        聚合方法的入参
 * @author 19242
 */
public interface ICustomBuildAggWrapper<AggWrapper extends IEsAggWrapper<AggWrapper, Wrapper>, Wrapper extends IEsLimitWrapper<Wrapper, AggWrapper>, Arg>
        extends IEsAggWrapper<AggWrapper, Wrapper> {
    /**
     * 自定义条件，
     *
     * @param name
     * @param arg  入参
     * @return
     */
    default AggWrapper builder(String name, Arg arg) {
        return setAgg(new Agg(AggEnum.BUILDER, name, null, arg));
    }
}
